package com.controller.abstractcontroller;

import com.vo.PlayerInstance;

/**
 * Created by 石头哥哥 on 8/19/16.
 * PACKAGE_NAME:  controller
 * COMMENT :
 */
public interface IController {

    /**
     * fast get ref which handle  data method
     * ${void DispatchFlatBuffer(final byte[] data, final PlayerInstance player)}
     * game_controllers[msgID]. DispatchFlatBuffer(data,player);
     * wrap table ,data[4,data.length-4];  msgID hand occupy  4
     */
     IController game_controllers[] = new IController[1024];

    /**
     * 基于flatBuffers 结构数据传输
     *
     * @param data   cast subclass of table .
     * @param player game session
     * @throws Exception
     */
    void DispatchFlatBuffer(final byte[] data, final PlayerInstance player)
            throws Exception;
}
